using UnityEngine;
using UnityEngine.UI;

public class LoadInfo : MonoBehaviour
{
	public Text name_Load;

	public SavesList saveList;

	private void Start()
	{
	}

	private void Update()
	{
	}

	public void LoadMap()
	{
		PlayerPrefs.SetString("LoadMap", name_Load.text);
		if (!PhotonNetwork.offlineMode && PhotonNetwork.insideLobby)
		{
			SavesAllFunctions.Local = false;
			Lobby.Instance.CreateRoom();
		}
		else
		{
			Application.LoadLevel("MainScene");
			SavesAllFunctions.Local = true;
		}
	}

	public void DeleteMap()
	{
		saveList.DeleteFile(name_Load.text);
		Object.Destroy(base.gameObject);
	}
}
